<?php
/**
 * Dependency top rank filter
 *
 * PHP version 5
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id:$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
require_once 'W/Dependency/Filter/Rank/Abstract.php';
/**
 * Dependency top rank filter
 *
 * @category  W
 * @package   Services
 * @author    Olivier Hoareau <olivier@phppro.fr>
 * @copyright 2009 PHPPRO http://www.phppro.fr
 * @license   http://dev.phppro.fr/license PHPPRO
 * @version   SVN: $Id$
 * @link      http://dev.phppro.fr/projects/wdependency
 */
class W_Dependency_Filter_TopRank extends W_Dependency_Filter_Rank_Abstract
{
    private $size;
    public function setSize($value)
    {
        $this->size = $value;
        return $this;
    }
    public function sortList($list,$data)
    {
        arsort($list);
        $d = array_slice($list,0,$this->size,true);
        return $d;
    }
}